/*
 * 创建日期 2009-3-17
 *
 * 成都天和软件公司
 * 电话：028-85425861
 * 传真：028-85425861-8008
 * 邮编：610041 
 * 版权所有
 */
package  org.fantasy.cpp.web.tag;

import javax.servlet.jsp.JspException;

import  org.fantasy.cpp.core.bean.ParamContext;
import  org.fantasy.cpp.core.bean.ParamContextImpl;
import  org.fantasy.cpp.core.html.EditHtml;
import  org.fantasy.cpp.core.tag.AbstractTag;

/**
 * 抽象编辑TAG
 */
public class BaseTag extends AbstractTag {
	
	public void setName(String name) {
        getParamContext().set(EditHtml.NAME, name);
    }
	
	public void setValidate(String validate) {
        getParamContext().set(EditHtml.VALIDATE, validate);
    }

	public void setStyle(String style) {
        getParamContext().set(EditHtml.CSS_STYLE, style);
    }

    public void setClassName(String className) {
        getParamContext().set(EditHtml.CSS_CLASS, className);
    }
    
    public void setValue(String value) {
        getParamContext().set(EditHtml.VALUE, value);
    }
    
    @Override
    protected void init() {
        pageContext.setAttribute(ParamContext.PARAM_CONTEXT, new ParamContextImpl());
    }
    
    @Override
    public int doStartTag() throws JspException {
        return EVAL_BODY_INCLUDE;
    }

    protected ParamContext getParamContext() {
        return (ParamContext) pageContext.getAttribute(ParamContext.PARAM_CONTEXT);
    }
}
